package com.example.backend;

import com.example.backend.Config.Config;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class BackEndApplication {

    @Autowired
    private Config config;
    public static void main(String[] args) {


       System.out.println("启动中...");
       ConfigurableApplicationContext context=SpringApplication.run(BackEndApplication.class, args);

       BackEndApplication app=context.getBean(BackEndApplication.class);

       System.out.println("启动成功");

       System.out.println("项目名称:\t\t"+app.config.getAppName());
       System.out.println("数据库：\t\t"+app.config.getDbUrl());
       System.out.println("数据库用户：\t"+app.config.getDbUsername());
       System.out.println("数据库密码：\t"+app.config.getDbPassword());

       System.out.println("访问路径：\thttp://localhost:"+app.config.getServerPort());
    }

}
